<body>
  <div id="root"></div>
  <script type="module">
    import { h, render } from "../../../src/index.js";
    import { withHooks, useState } from "./withHooks.js";

    const Counter = withHooks(props => {
      const [count, setCount] = useState(0);

      return h(
        "h1",
        null,
        h("p", null, "Count: ", count),
        h("button", { onclick: () => setCount(count => count + 1) }, "+")
      );
    });

    const root = document.getElementById("root");
    render(h("div", null, h(Counter), h(Counter)), root);
  </script>
</body>
